<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="referrer" content="origin">
    <title>车辆列表-市场</title>
    <link rel="stylesheet" type="text/css" href="../css/login.css">
    <link rel="stylesheet" type="text/css" href="../js/layer/theme/default/layer.css">
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/config.js"></script>
    <script type="text/javascript" src="../js/filter.js"></script>
    <script type="text/javascript" src="../js/paging.js"></script>
    <script type="text/javascript" src="../js/layer/layer.js"></script>
  </head>
  <body style="background:#fff;">
  	<form id="searchForm">
      <div class="search-bar clearfix panel" style="height: auto;padding-bottom: 0px;">
        <div class="box">
          <div class="cell-search">
            <label>基本信息</label>
            <input type="hidden" name="marketId">
            <select name="shopId">
              <option value="">请选择店铺</option>
              <option v-for="shopItem in shopList" :value="shopItem.shopId">{{shopItem.shopName}}</option>
            </select>
          </div> 
          <div class="cell-search">
            <label>车辆信息</label>
            <select name="brandId" onchange="getSeriesId(this.value)">
              <option value="">请选择品牌</option>
              <option :value="brandItem.brandId" :id="brandItem.brandId" v-for="brandItem in brandList" >{{brandItem.brandName}}</option>
            </select>
            <select name="seriesId" onchange="getModelId(this.value)">
              <option value="">请选择车系</option>
              <option :value="seriesItem.seriesId" :id="seriesItem.seriesId" v-for="seriesItem in seriesList" >{{seriesItem.seriesName}}</option>
            </select>
            <select name="modelId">
              <option value="">请选择车型</option>
              <option :value="modelItem.modelId" :id="modelItem.modelId" v-for="modelItem in modelList" >{{modelItem.modelName}}</option>
            </select>
            <select onchange="changePrice(this)">
              <option value="">请选择零售价</option>
              <option value="1">0-5万</option>
              <option value="2">5-10万</option>
              <option value="3">10-20万</option>
              <option value="4">20-30万</option>
              <option value="5">30-50万</option>
              <option value="6">50-100万</option>
              <option value="7">100万以上</option>
            </select>
            <input type="hidden" name="fromRetailPrice">
            <input type="hidden" name="toRetailPrice">
          </div> 
          <div class="cell-search">
            <label>状态</label>
            <select name="carStockState">
              <option value="">请选择库存状态</option>
              <option value="0">未入库</option>
              <option value="10">入库中</option>
              <option value="20">已入库</option>
              <option value="30">出库中</option>
              <option value="40">已出库</option>
            </select>
            <select name="carDetectState">
              <option value="">请选择检测状态</option>
              <option value="500">未初检</option>
              <option value="510">初检不通过</option>
              <option value="520">初检通过</option>
              <option value="530">申请复检中</option>
              <option value="540">复检完成</option>
            </select>
            <select name="carSaleState">
              <option value="">请选择上架状态</option>
              <option value="0">未上架</option>
              <option value="10">上架中</option>
              <option value="20">已上架</option>
              <option value="30">已下架</option>
            </select>
          </div>
          <div class="cell-search">
            <label>车辆状态</label>
            <select name="carPledgeState">
              <option value="">请选择抵押状态</option>
              <option value="300">未抵押</option>
              <option value="310">已抵押</option>
            </select>
            <select name="carSiteState">
              <option value="">请选择在场状态</option>
              <option value="400">未入场</option>
              <option value="410">已入场</option>
              <option value="420">出场审核中</option>
              <option value="430">出场审核通过</option>
              <option value="440">已出场</option>
            </select>
          </div>
          <div class="cell-search">
            <label>更多信息</label>
            <select name="carTypeId">
              <option value="">请选择车身类型</option>
              <option :value="carTypeItem.carTypeId" v-for="carTypeItem in carTypeList">{{carTypeItem.carTypeName}}</option>
            </select>
            <select  onchange="changeCarAge(this)">
              <option value="">请选择车龄</option>
              <option value="1">1年内</option>
              <option value="2">1-3年</option>
              <option value="3">3-5年</option>
              <option value="4">5-8年</option>
              <option value="5">8-10年</option>
              <option value="6">10年以上</option>
            </select>
              <input type="hidden" name="fromCarAge">
              <input type="hidden" name="toCarAge">
            <select  onchange="changeMileage(this)">
              <option value="">请选择里程</option>
              <option value="1">1万公里内</option>
              <option value="2">3万公里内</option>
              <option value="3">6万公里内</option>
              <option value="4">10万公里内</option>
              <option value="5">10万公里以上</option>
            </select>
              <input type="hidden" name="fromMileage">
              <input type="hidden" name="toMileage">
            <select  name="carEnviron">
              <option value="">请选择环保标准</option>
              <option value="国I">国I</option>
              <option value="国II">国II</option>
              <option value="国III">国III</option>
              <option value="国IV">国IV</option>
              <option value="国V">国V</option>
              <option value="欧I">欧I</option>
              <option value="欧II">欧II</option>
              <option value="欧III">欧III</option>
              <option value="欧IV">欧IV</option>
              <option value="欧V">欧V</option>
              <option value="欧VI">欧VI</option>
            </select>
          </div>
          <div class="cell-search">
            <label>vin码查询</label>
            <input type="text" name="carVin6" placeholder="请输入vin码后六位">
          </div>
          <div class="search-btn-box">
            <button type="button" id="serchBtn">查询</button>
            <a  href="add_market.html"  class="add-button">新增车辆</a>
          </div>
        </div>
      </div>
    </form>
    <!-- <div style="text-align: right;padding: 0 40px"></div> -->
    <div class="" id="app">
      <table class="list-box cars-table">
        <thead>
          <tr>
            <th>首图</th>
            <th>车辆信息</th>
            <th>价格信息</th>
            <th>车商注册信息</th>
            <th>车辆联系人信息</th>
            <th>所属区域</th>
            <!-- <th>车辆状态</th> -->
            <th>库存状态</th>
            <th>检测状态</th>
            <th>认证状态</th>
            <th>车辆状态</th>
            <th>RFID状态</th>
            <th >操作</th>  
          </tr>
        </thead>
        
        <tbody>
          <tr v-for="re in res">
            <td class="cars-img">
              <img  v-if="re.carImageUrl" v-bind:src="imgUrl + re.carImageUrl+'.w_200xh_200'">
              <img src="../images/default.png" v-else="re.carImageUrl">
            </td>
            <td>
              <h1>{{re.carTitle}}</h1>
              <p>车架号:{{re.carVin}}</p>
              <p>上牌日期:{{re.carLicenceDate | filterGetDate}}</p>
              <p>车牌号:{{re.carPlate }}</p>
              <p class="color-span"><span>{{re.carMileage}}万公里</span><span>{{re.carDisplacement + re.carInletModel}}</span><span>{{re.carOutColor}}</span></p>
            </td>
            <td>
              <p>零售价:{{re.carRetailPrice}}万元</p>
            </td>
            <td>
              <p>公司:{{re.shop.shopName}}</p>
              <p>法人:{{re.shop.shopLegalName}}</p>
              <p>联系电话:{{re.shop.shopLegalMobile}}</p>
            </td>
            <td>
              <p>车商联系人:{{re.shop.shopManageName}}</p>
              <p>联系方式:{{re.shop.shopManageMobile}}</p>
            </td>
            <td>
              <p style="text-align: center;">{{re.region.regionName}}</p>
            </td>
<!--             <td style="text-align: center;">
              <p>{{re.carStockState | filterCarStockState}}</p>
              <p>{{re.carDetectState | filterCarDetectState }}</p>
              <p>{{re.carSaleState | filterCarSaleState }}</p>
              <p>{{re.carAuthState | filterCarAuthState }}</p>
              <p>{{re.carOrderState | filterCarOrderState }}</p>
            </td> -->
            <td style="text-align: center;">
              <p>{{re.carStockState | filterCarStockState}}</p>
              <p>{{re.carSaleState | filterCarSaleState }}</p>
              <p>{{re.carOrderState | filterCarOrderState }}</p>
            </td>
            <td style="text-align: center;">
              <p>{{re.carDetectState | filterCarDetectState }}</p>
            </td>
            <td style="text-align: center;">
              <p>{{re.carAuthState | filterCarAuthState }}</p>
            </td>
            <td style="text-align: center;">
              <p>{{re.carPledgeState | filterCarPledgeState }}</p>
              <p><a class="over-small"  v-bind:id="re.carId" onclick="checkPledgeImg(id)">查看权证照片</a></p>
              <p><a class="over-small"  v-bind:id="re.carId" onclick="showCarLogPledge(id)">查看抵押操作日志</a></p>
              <p><span v-if="re.carSiteState == 440">{{re.carSiteTime | filterGetTime}}</span> {{re.carSiteState | filterCarSiteState }}</p>
              <p v-if="re.carSiteStatus == 1" style="color: red">该车已出场5个小时以上！</p>
            </td>
            <td style="text-align: center;">
              <div v-if="re.carRfid">
                <p>已绑定</p>
                <p>RFID:{{re.carRfid}}</p>
              </div>
              <p v-else="">未绑定</p>
            </td>
            <td class="cars-control">
              <a class="over-small" v-bind:id="re.carId" onclick="goToEdit(id)" >编辑车辆</a>
              <a class="over-small" v-bind:id="re.carId" onclick="goToDetial(id)" >查看详情</a>
<!--               <div v-if="re.carStockState == 20">
                <a class="over-small" v-bind:id="re.carId" v-if="re.carSaleState == 10" onclick="carSaleState(id)">上架审核</a>
              </div> -->
              <!-- <a class="over-small" v-bind:id="re.carId" v-if="re.carStockState == 30" onclick="carStockState(id)">出库审核</a> -->
              <a class="over-small" v-bind:id="re.carId" v-if="re.carStockState == 10" onclick="carInStockState(id)">入库审核</a>
              <a class="over-small" v-if="re.carOrderState == 1" v-bind:id="re.carId" onclick="goToOrder(id)" >预订详情</a>
              <a class="over-small" v-if="re.carStockState >= 30" v-bind:id="re.carId" onclick="goToSale(id)" >销售详情</a>
              
<!--               <a class="over-small" v-if="re.carSiteState == 410 && re.carPledgeState == 300" v-bind:id="re.carId"  onclick="pledgeImg(id)">车辆抵押</a>
              <a class="over-small" v-if="re.carPledgeState == 310" v-bind:id="re.carId"  onclick="rePledge(id)">车辆解押</a>
              <a class="over-small" v-if="re.carSiteState == 420" v-bind:id="re.carId"  onclick="outSite(id)">临时出场审核</a> -->
              
              <a class="over-small" target="_blank" v-bind:href="'pricetag.html?carId='+re.carId" v-if="re.carSaleState == 20">打印价签</a>
              <a class="over-small" target="_blank" v-bind:href="'cert.html?carId='+re.carId" v-if="re.carAuthState == 10 && re.carDetectState == 540" >打印证书</a>
              <span v-if="re.carRfid"><a class="over-small" v-bind:id="re.carId" v-bind:market-id="re.marketId" v-if="re.carStockState < 40" :data-rfid="re.carRfid" onclick="changeBindRFID(this)" >更换RFID</a></span>
              <span v-else="re.carRfid"><a class="over-small" v-bind:id="re.carId" v-bind:market-id="re.marketId" v-if="re.carStockState < 40" data-rfid="" onclick="bindRFID(this)" >绑定RFID</a></span>
              <a class="over-small"   v-bind:id="re.carId" onclick="showCarLog(id)" >操作日志</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div id="page" class="page_div"></div>
    <div class="loading"></div>
    <div id="pledgeBox" style="display:none">
      <div class="box clearfix" >
        <div class="image-list" v-for="(carImage,index) in carImgList">
          <img src="../images/default.png" alt="请上传图片" onerror="javascript:this.src='../images/default.png'">
          <div class="image-loading"></div>
          <p>{{carImage | filterImageName}}</p>
          <input type="file"  accept="image/*" name="" onchange="changeImg(this)" v-bind:id="carImage" :data-imageKey="carImage" data-imageUrl="" :data-imageSeq="index+1">
        </div>
        <div></div>
      </div>
    </div>
    <div id="checkPledgeBox" style="display:none">
      <div class="box clearfix" >
        <div class="image-list" v-for="(carImage,index) in pledgeImgList">
          <img :src="imgUrl+carImage.imageUrl"   onerror="javascript:this.src='../images/default.png'"  onclick="showBigImg(this)">
          <p>{{carImage.imageKey | filterImageName}}</p>
        </div>
        <div></div>
      </div>
    </div>
    <div id="carLogBox" style="display:none">
      <table class="car-log">
        <tr>
          <th width="200">时间</th>
          <th>操作</th>
          <th width="150">操作人</th>
        </tr>
        <tr v-for="item in logList">
          <td  align="center">{{item.carLogCreateTime | filterGetTime}}</td>
          <td>{{item.carLogInfo}}</td>
          <td  align="center">{{item.user.userName}}</td>
        </tr>
      </table>
    </div>
    
  </body>
  <script type="text/javascript">
    // layer.confirm('确定要申请上架吗？', {
    //   btn: ['申请上架','取消'] //按钮
    // }
    
    $('input[name=marketId]').val(marketId);

    // 查看权证照片
    var checkPledgeBox = new Vue({
      el:'#checkPledgeBox',
      data: {
        imgUrl:imgUrl,
        pledgeImgList:[],
      }
    });
    // 抵押车辆
    var pledgeBox = new Vue({
      el:'#pledgeBox',
      data: {
        imgList:[],
        carImgList:["pledge_vehicle_license", "pledge_registration_license", "pledge_keys", "pledge_invoice", "pledge_insurance", "pledge_duty_paid"],
      }
    });
  </script>

  <script type="text/javascript" src="../js/search.js"></script>

</html>


































